package com.cskaoyan.market.controller;

import com.cskaoyan.market.service.WxCatalogService;
import com.cskaoyan.market.util.ResponseUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @author cx
 * @date 2023/4/3 19:13
 * @Version 1.0
 */
@RestController
@RequestMapping("wx/catalog")
public class WxCatalogController {
    @Autowired
    WxCatalogService wxCatalogService;
    @GetMapping("index")
    public Object index(){
        Map<String, Object> result = wxCatalogService.index();
        return ResponseUtil.ok(result);
    }

    @GetMapping("current")
    public Object current(Integer id){
        Map<String, Object> result = wxCatalogService.current(id);
        return ResponseUtil.ok(result);
    }

}
